package work.binarysearch;

public class Problem153 {
    public int findMin(int[] nums) {
        int n = nums.length;
        int left = 0, right = n - 1;
        while (left <= right) {
            int mid = (right+left)/2;
            if (nums[mid]<=nums[right]) right = mid;
            else left = mid+1;
        }
        return left;
    }
}
